package blackjack.server;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

class ActiveSessions {
	int g = 0;
	int kokku = 0;
	private Collection<ClientSession> sessionList = new ArrayList<ClientSession>(); // clients kollektsioon

	public synchronized void addSession(ClientSession s) { // this lock
		sessionList.add(s);
		System.out.println("Saabus uus klient: " + s);
	}

	public Iterator<ClientSession> iterator() { 
		return sessionList.iterator();
	}

	public int getAmountOfPlayers(){
		return sessionList.size();
	}
	
}